<?php
namespace app\model\auth;

use think\Model;
use think\model\concern\SoftDelete;
use app\traits\Hierarchy;

/*
 * 权限模型.
 *
 * @property integer $id
 */
class Perm extends Model
{
    use Hierarchy;

    protected $table = 'auth_perm';      // 表名

    /*
     * @inheritdoc
     */
    protected $field = [
		'name',
        'pid'
    ];
    public function children(){
        return $this->hasMany(self::class, 'pid', 'code');
    }
}
